<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!--公共布局-->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" type="text/css" href="../../css/global/public.css"/>
<link rel="stylesheet" type="text/css" href="../../css/novice.css"/>
<link rel="stylesheet" href="../../css/global/mui.css" />
<title>新手有礼</title>
</head>
<body>
	<!--<div class="top-prompt">感谢关注馨语医疗，新用户实名注册即可得</br>50元体验金以便于您与您的医生顺利交流。</div>
	<div class="condition-list">
		<ul>
			<li>用户新注册50元图文咨询红包</li>
			<li>用户点击个人中心-我的余额可查看</li>
			<li>余额不可提现，仅可用于图文咨询</li>
		</ul>
	</div>-->
	<div class="peck-gift">
		<div id="button-red">
			<img class="click-red" src="../../images/click-red.png" alt="" />
			<img class="click-gray" src="../../images/click-gray.png"/ style="display:none;">
		</div>
	</div>
</body>

<script type="text/javascript" src="../../js/lib/mui.min.js"></script>
<script type="text/javascript" src="../../js/common/common.js"></script>
<script type="text/javascript" src="../../js/module/utilModule.js" ></script> 
<!--配置信息-->
<script type="text/javascript" src="../../js/common/config.js"></script>
<script type="text/javascript" src="../../js/lib/zepto.min.js" ></script>

<script>
  $(document).ready(function(){
  	utilModule.get({
        url: "userCenter/getIsNewPatient?id="+USERID,
        needJson: false, 
        async: false,
        success: function (response) {
        	if(response==1){
        		$("#button-red").attr("data-status",1);
        		
        	}else{
        		$("#button-red").attr("data-status",0);
        		$(".click-red").hide();
        		$(".click-gray").show();
        		/*$("#button-red ").css("background","#c2c2c2");*/
        	}
        }
    });
    $("#button-red").on('click',function(){
    	var status =$("#button-red").data("status");
    	if(status ==1){
    		utilModule.post({
    				url: "userCenter/getNewPatientRedPacket",
    				data:{"id":USERID},
			        needJson: false, 
			        async: false,
			        success: function (response) {
			        	if(response ==1){
			        		mui.alert("领取成功","提示",function(){
			        			//location.replace("../../index.html");
			        			location.href = "../../index.html";
			        		});
			        		
			        	}else{
			        		mui.alert("领取失败","提示");
			        	}
			        }
    		});
    	}else{
    		mui.alert("您已领取","提示",function(){
    			//location.replace("../../index.html");
    			location.href = "../../index.html";
    		});
    	}
    });
  });
</script>
</html>
